import {request} from '@umijs/max';
import * as API from "@/services";


/** 支付配置 分页检索请求 */
export async function queryPayConfigs(params: API.PayConfigPageQueryParams): Promise<API.RespPageResult<API.PayConfig>> {
  return request('/api/v1/pay-config', {
    params,
  });
}

/** 支付配置 详情请求 */
export async function queryPayConfig(bizId: API.EntityId): Promise<API.RespResult<API.PayConfig>> {
  return request(`/api/v1/pay-config/${bizId}`);
}

/** 支付配置 创建请求 */
export async function createPayConfig(entity: API.PayConfig_Create): Promise<API.RespResult<any>> {
  return request(`/api/v1/pay-config`, {
    method: 'POST',
    data: entity,
  });
}

/** 支付配置 修改请求 */
export async function modifyPayConfig(entity: API.PayConfig_Modify): Promise<API.RespResult<any>> {
  return request(`/api/v1/pay-config/${entity.id}`, {
    method: 'PUT',
    data: entity,
  });
}

/** 支付配置 修改(部分)请求 */
export async function patchPayConfig(entity: API.PayConfig_Patch): Promise<API.RespResult<any>> {
  return request(`/api/v1/pay-config/${entity.id}`, {
    method: 'PATCH',
    data: entity,
  });
}

/** 支付配置 删除请求 */
export async function deletePayConfig(bizId: API.EntityId): Promise<API.RespResult<any>> {
  return request(`/api/v1/pay-config/${bizId}`, {
    method: 'DELETE',
  });
}

/** 支付配置 批量删除请求 */
export async function deletePayConfigs(bizIds: API.EntityId[]): Promise<API.RespResult<any>> {
  return request(`/api/v1/pay-config`, {
    method: 'DELETE',
    data: {
      ids: bizIds,
    },
  });
}
